package org.xworker.rap;

import org.eclipse.swt.widgets.Shell;
import org.xmeta.ActionContext;
import org.xmeta.Thing;
import org.xmeta.World;
import org.xmeta.annotation.ActionField;

public class Main {
    @ActionField
    public Shell shell;

    public void logout() {
        ActionContext ac = new ActionContext();
        ac.put("parent", shell.getDisplay());

        Thing prototype = World.getInstance().getThing("org.xworker.rap.Login");
        Shell loginShell = prototype.doAction("create", ac);
        shell.dispose();

        loginShell.setVisible(true);
        loginShell.setFocus();
    }

    public void exit() {
        shell.dispose();
    }
}
